package com.yy.daili;

public class StudentProxy implements Person{

    //声明一个被代码对象
    Student student;

    public StudentProxy(Person stu){
        if(stu.getClass()==Student.class){
            this.student=(Student) stu;
        }
    }
    @Override
    public void giveMoney() {
        System.out.println(student.getName()+"表现良好++++++++");
        student.giveMoney();
        System.out.println("===============运行结束啦");
    }
}
